package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.CshBankAccountMapper;
import com.bestow.basic.domain.CshBankAccount;
import com.bestow.basic.service.ICshBankAccountService;

/**
 * 银行支行Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-26
 */
@Service
public class CshBankAccountServiceImpl implements ICshBankAccountService 
{
    @Autowired
    private CshBankAccountMapper cshBankAccountMapper;

    /**
     * 查询银行支行
     * 
     * @param bankAccountId 银行支行主键
     * @return 银行支行
     */
    @Override
    public CshBankAccount selectCshBankAccountByBankAccountId(Long bankAccountId)
    {
        return cshBankAccountMapper.selectCshBankAccountByBankAccountId(bankAccountId);
    }

    /**
     * 查询银行支行列表
     * 
     * @param cshBankAccount 银行支行
     * @return 银行支行
     */
    @Override
    public List<CshBankAccount> selectCshBankAccountList(CshBankAccount cshBankAccount)
    {
        return cshBankAccountMapper.selectCshBankAccountList(cshBankAccount);
    }

    /**
     * 新增银行支行
     * 
     * @param cshBankAccount 银行支行
     * @return 结果
     */
    @Override
    public int insertCshBankAccount(CshBankAccount cshBankAccount)
    {
        cshBankAccount.setCreateTime(DateUtils.getNowDate());
        return cshBankAccountMapper.insertCshBankAccount(cshBankAccount);
    }

    /**
     * 修改银行支行
     * 
     * @param cshBankAccount 银行支行
     * @return 结果
     */
    @Override
    public int updateCshBankAccount(CshBankAccount cshBankAccount)
    {
        cshBankAccount.setUpdateTime(DateUtils.getNowDate());
        return cshBankAccountMapper.updateCshBankAccount(cshBankAccount);
    }

    /**
     * 批量删除银行支行
     * 
     * @param bankAccountIds 需要删除的银行支行主键
     * @return 结果
     */
    @Override
    public int deleteCshBankAccountByBankAccountIds(Long[] bankAccountIds)
    {
        return cshBankAccountMapper.deleteCshBankAccountByBankAccountIds(bankAccountIds);
    }

    /**
     * 删除银行支行信息
     * 
     * @param bankAccountId 银行支行主键
     * @return 结果
     */
    @Override
    public int deleteCshBankAccountByBankAccountId(Long bankAccountId)
    {
        return cshBankAccountMapper.deleteCshBankAccountByBankAccountId(bankAccountId);
    }
}
